Ch. 1 Linear Algebra

Return to TOC

Determinants

∣abcd∣=ad−bc \begin{vmatrix} a & b \\ c & d \end{vmatrix} =ad-bc

∣abcdefghi∣=aei−afh−bdi+bfg+cdh−ceg \begin{vmatrix} a & b & c \\ d & e & f \\ g & h & i \\ \end{vmatrix} = aei-afh-bdi+bfg+cdh-ceg
Determinants of 3x3 matrices can be determined in two ways: Cofactor Method and Basket Weaving Method

Cofactor Method

  1. Choose a row or column (henceforth referred to as NN)

  2. Find the minor of each element in NN

  3. Multiply each element by its respective minor and add or subtract based on this pattern [+−+−+−+−+]\begin{bmatrix}+&-&+\\-&+&-\\+&-&+\end{bmatrix}

Example 1.1 & 1.2

Evaluate ∣−12345−6−789∣\begin{vmatrix}-1&2&3\\4&5&-6\\-7&8&9\end{vmatrix} using the cofactor method.


Example 1.1 Using top row ∣−12345−6−789∣\begin{vmatrix}\textcolor{#EE4266}{-1}&\textcolor{#EE4266}{2}&\textcolor{#EE4266}{3}\\4&5&-6\\-7&8&9\end{vmatrix} 1. Elements are −1\textcolor{#EE4266}{-1}, 2\textcolor{#EE4266}{2}, 3\textcolor{#EE4266}{3}
2. Calculate minors
2a. Minor for −1-1 is ∣5−689∣=(5)(9)−(−6)(8)=93\begin{vmatrix}5&-6\\8&9\end{vmatrix}=(5)(9)-(-6)(8)=\textcolor{#C2FBEF}{93}
2b. Minor for 22 is ∣4−6−79∣=(4)(9)−(−6)(−7)=−6\begin{vmatrix}4&-6\\-7&9\end{vmatrix}=(4)(9)-(-6)(-7)=\textcolor{#C2FBEF}{-6}
2c. Minor for 33 is ∣45−78∣=(4)(8)−(5)(−7)=67\begin{vmatrix}4&5\\-7&8\end{vmatrix}=(4)(8)-(5)(-7)=\textcolor{#C2FBEF}{67}
3. (−1)(93)−(2)(−6)+(3)(67)=120(-1)(\textcolor{#C2FBEF}{93})-(2)(\textcolor{#C2FBEF}{-6})+(3)(\textcolor{#C2FBEF}{67})=120
Example 1.2 Using middle column ∣−12345−6−789∣\begin{vmatrix}-1&\textcolor{#EE4266}{2}&3\\4&\textcolor{#EE4266}{5}&-6\\-7&\textcolor{#EE4266}{8}&9\end{vmatrix} 1. Elements are 2\textcolor{#EE4266}{2}, 5\textcolor{#EE4266}{5}, 8\textcolor{#EE4266}{8}
2. Calculate minors
2a. Minor for 22 is ∣4−6−79∣=(4)(9)−(−6)(−7)=−6\begin{vmatrix}4&-6\\-7&9\end{vmatrix}=(4)(9)-(-6)(-7)=\textcolor{#C2FBEF}{-6}
2b. Minor for 55 is ∣−13−79∣=(−1)(9)−(3)(−7)=12\begin{vmatrix}-1&3\\-7&9\end{vmatrix}=(-1)(9)-(3)(-7)=\textcolor{#C2FBEF}{12}
2c. Minor for 88 is ∣−134−6∣=(−1)(−6)−(3)(4)=−6\begin{vmatrix}-1&3\\4&-6\end{vmatrix}=(-1)(-6)-(3)(4)=\textcolor{#C2FBEF}{-6}
3. −(2)(−6)+(5)(12)−(8)(−6)=120-(2)(\textcolor{#C2FBEF}{-6})+(5)(\textcolor{#C2FBEF}{12})-(8)(\textcolor{#C2FBEF}{-6})=120

Basket Weaving Method

  1. Copy the first two columns to the right of the matrix
  2. Multiply the elements in each diagonal as shown in the image
  3. Add the ones going down, subtract the ones going up
Example 1.3

Evaluate ∣−12345−6−789∣\begin{vmatrix}-1&2&3\\4&5&-6\\-7&8&9\end{vmatrix} using the basket-weaving method


  1. ∣−123−1245−645−789−78∣\begin{vmatrix}-1&2&3&-1&2\\4&5&-6&4&5\\-7&8&9&-7&8\end{vmatrix}
  2. The products of the diagonals are:
  1. The first three are added and the last three are subtracted

Cramer's Rule

Method of solving a system of 3 linear equations of 3 variables
The system of equations
a1x+b1y+c1z=C1a2x+b2y+c2z=C2a3x+b3y+c3z=C3 a_1x+b_1y+c_1z=\textcolor{#F79256}{C_1}\\ a_2x+b_2y+c_2z=\textcolor{#F79256}{C_2}\\ a_3x+b_3y+c_3z=\textcolor{#F79256}{C_3}\\
can be represented in matrix form as
[a1b1c2a2b2c2a3b3c3][xyz]=[C1C2C3] \begin{bmatrix} a_1 & b_1 & c_2\\ a_2 & b_2 & c_2\\ a_3 & b_3 & c_3 \end{bmatrix} \begin{bmatrix} x\\y\\z \end{bmatrix} = \begin{bmatrix} \textcolor{#F79256}{C_1}\\\textcolor{#F79256}{C_2}\\\textcolor{#F79256}{C_3} \end{bmatrix}
and the solutions are
x=∣C1b1c1C2b2c2C3b3c3∣∣a1b1c2a2b2c2a3b3c3∣,y=∣a1C1c1a2C2c2a3C3c3∣∣a1b1c2a2b2c2a3b3c3∣,z=∣a1b1C1a2b2C2a3b3C3∣∣a1b1c2a2b2c2a3b3c3∣ x=\frac{\begin{vmatrix}\textcolor{#F79256}{C_1}&b_1&c_1\\\textcolor{#F79256}{C_2}&b_2&c_2\\\textcolor{#F79256}{C_3}&b_3&c_3\end{vmatrix}}{\begin{vmatrix}a_1&b_1&c_2\\a_2&b_2&c_2\\a_3&b_3&c_3\end{vmatrix}}, y=\frac{\begin{vmatrix}a_1&\textcolor{#F79256}{C_1}&c_1\\a_2&\textcolor{#F79256}{C_2}&c_2\\a_3&\textcolor{#F79256}{C_3}&c_3\end{vmatrix}}{\begin{vmatrix}a_1&b_1&c_2\\a_2&b_2&c_2\\a_3&b_3&c_3\end{vmatrix}}, z=\frac{\begin{vmatrix}a_1&b_1&\textcolor{#F79256}{C_1}\\a_2&b_2&\textcolor{#F79256}{C_2}\\a_3&b_3&\textcolor{#F79256}{C_3}\end{vmatrix}}{\begin{vmatrix}a_1&b_1&c_2\\a_2&b_2&c_2\\a_3&b_3&c_3\end{vmatrix}}

Example 1.4

Solve the following system using Cramer's Rule
−12x−4y+4z=−210x+0y−4z=612x+12y+4z=−1 -12x-4y+4z=\textcolor{#F79256}{-21}\\ 0x+0y-4z=\textcolor{#F79256}{6}\\ 12x+12y+4z=\textcolor{#F79256}{-1}


The matrix form is
[−12−4400−412124][xyz]=[−216−1] \begin{bmatrix} -12&-4&4\\ 0&0&-4\\ 12&12&4 \end{bmatrix} \begin{bmatrix}x\\y\\z\end{bmatrix} =\begin{bmatrix} \textcolor{#F79256}{-21}\\ \textcolor{#F79256}{6}\\ \textcolor{#F79256}{-1} \end{bmatrix}
The denominator is the determinant of the 3x3 matrix
This is easily computed using cofactor method on the second row, taking advantage of the 00s
∣−12−4400−412124∣=−0+0−(−4){(−12)(12)−(−4)(12)}=−384 \begin{vmatrix} -12&-4&4\\ 0&0&-4\\ 12&12&4 \end{vmatrix} =-0+0-(-4)\textcolor{#F79256}{\{}(-12)(12)-(-4)(12)\textcolor{#F79256}{\}}=\textcolor{#C2FBEF}{-384}
Finally, we can use the formula for each variable
Start with xx, using cofactor method on the second row
x=∣−21−4460−4−1124∣−384=−6{(−4)(4)−(4)(12)}+0−(−4){(−21)(12)−(−4)(−1)}−384=384−1024−384=53 x=\frac{\begin{vmatrix}\textcolor{#F79256}{-21}&-4&4\\\textcolor{#F79256}{6}&0&-4\\\textcolor{#F79256}{-1}&12&4\end{vmatrix}}{\textcolor{#C2FBEF}{\textcolor{#C2FBEF}{-384}}}=\frac{-6\textcolor{#F79256}{\{}(-4)(4)-(4)(12)\textcolor{#F79256}{\}}+0-(-4)\textcolor{#F79256}{\{}(-21)(12)-(-4)(-1)\textcolor{#F79256}{\}}}{\textcolor{#C2FBEF}{-384}}=\frac{384-1024}{\textcolor{#C2FBEF}{-384}}=\frac{5}{3}
Next yy, using cofactor method on the second row
y=∣−12−21406−412−14∣−384=−0+6{(−12)(4)−(4)(12)}−(−4){(−12)(−1)−(−21)(12)}−384=−0+(−576)−(−1056)−384=−54 y=\frac{\begin{vmatrix}-12&\textcolor{#F79256}{-21}&4\\0&\textcolor{#F79256}{6}&-4\\12&\textcolor{#F79256}{-1}&4\end{vmatrix}}{\textcolor{#C2FBEF}{-384}}=\frac{-0+6\textcolor{#F79256}{\{}(-12)(4)-(4)(12)\textcolor{#F79256}{\}}-(-4)\textcolor{#F79256}{\{}(-12)(-1)-(-21)(12)\textcolor{#F79256}{\}}}{\textcolor{#C2FBEF}{-384}}=\frac{-0+(-576)-(-1056)}{\textcolor{#C2FBEF}{-384}}=-\frac{5}{4}
Finally zz, using cofactor method on the second row
z=∣−12−4−210061212−1∣−384=−0+0−6{(−12)(12)−(−4)(12)}−384=−0+0−(−576)−384=−32 z=\frac{\begin{vmatrix}-12&-4&\textcolor{#F79256}{-21}\\0&0&\textcolor{#F79256}{6}\\12&12&\textcolor{#F79256}{-1}\end{vmatrix}}{\textcolor{#C2FBEF}{-384}}=\frac{-0+0-6\textcolor{#F79256}{\{}(-12)(12)-(-4)(12)\textcolor{#F79256}{\}}}{\textcolor{#C2FBEF}{-384}}=\frac{-0+0-(-576)}{\textcolor{#C2FBEF}{-384}}=-\frac{3}{2}
So the solution to the system is (x,y,z)=(53,−54,−32)(x,y,z)=(\frac{5}{3},-\frac{5}{4},-\frac{3}{2})


Inverse Matrix

The inverse of matrix MM is M−1M^{-1}, and satisfies M−1M=IM^{-1}M=I, where II is the identity matrix
M−1M^{-1} exists if and only ifdet⁡M≠0\det{M}\ne0
If M−1M^{-1} does not exist, the matrix is singular
The inverse matrix can be found in three ways: from the Adjugate Matrix, Gauss-Jordan Elimination/Row Reduction, or with a calculator

Adjugate Matrix

  1. Transpose the matrix (reflect each element across the main diagonal) (MTM^T)
  2. Find the 2x2 minor of each element
  3. Create a 3x3 matrix from the minors, changing signs based on the pattern
    [+−+−+−+−+]\begin{bmatrix}+&-&+\\-&+&-\\+&-&+\end{bmatrix}
  4. Divide the resulting matrix by det⁡M\det{M}
Example 1.5

Find the inverse of M=[−12−4400−412124]M=\begin{bmatrix}-12&-4&4\\0&0&-4\\12&12&4\end{bmatrix}


  1. MT=[−12012−40124−44]M^T=\begin{bmatrix}-12&0&12\\-4&0&12\\4&-4&4\end{bmatrix}
  2. ∣012−44∣=48,∣−41244∣=−64,∣−404−4∣=16\begin{vmatrix}0&12\\-4&4\end{vmatrix}=48, \begin{vmatrix}-4&12\\4&4\end{vmatrix}=-64, \begin{vmatrix}-4&0\\4&-4\end{vmatrix}=16
    ∣012−44∣=48,∣−121244∣=−96,∣−1204−4∣=48\begin{vmatrix}0&12\\-4&4\end{vmatrix}=48, \begin{vmatrix}-12&12\\4&4\end{vmatrix}=-96, \begin{vmatrix}-12&0\\4&-4\end{vmatrix}=48
    ∣012012∣=0,∣−1212−412∣=−96,∣−120−40∣=0\begin{vmatrix}0&12\\0&12\end{vmatrix}=0, \begin{vmatrix}-12&12\\-4&12\end{vmatrix}=-96, \begin{vmatrix}-12&0\\-4&0\end{vmatrix}=0
  3. adj(M)=[486416−48−96−480960]\text{adj}(M)=\begin{bmatrix}48&64&16\\-48&-96&-48\\0&96&0\end{bmatrix}
  4. MT=1det⁡Madj(M)=1−384[486416−48−96−480960]=[−48/384−64/384−16/38448/38496/38448/3840−96/3840]=[−1/8−1/6−1/241/81/41/80−1/40]M^T=\frac{1}{\det{M}}\text{adj}(M)=\frac{1}{-384}\begin{bmatrix}48&64&16\\-48&-96&-48\\0&96&0\end{bmatrix}=\begin{bmatrix}-48/384&-64/384&-16/384\\48/384&96/384&48/384\\0&-96/384&0\end{bmatrix}=\begin{bmatrix}-1/8&-1/6&-1/24\\1/8&1/4&1/8\\0&-1/4&0\end{bmatrix}

Gauss-Jordan Elimination/Row Reduction

If you have an n×nn\times n matrix, append the n×nn\times n identity matrix to the right.
The goal is to use the following 3 rules to turn the original matrix into the identity matrix.
This will make the identity matrix turn into the inverse matrix.

Example 1.6: 2x2 Matrix

Find the inverse of [2315]\begin{bmatrix}2&3\\1&5\end{bmatrix} using Row Reduction


Append the identity matrix. The divider is added to differentiate the two matrices.
[23∣1015∣01]\begin{bmatrix}2&3&\textcolor{#F79256}{|}&1&0\\1&5&\textcolor{#F79256}{|}&0&1\end{bmatrix}
Swap the two rows to get a 11 in the top left.
[15∣0123∣10]\begin{bmatrix}1&5&\textcolor{#F79256}{|}&0&1\\2&3&\textcolor{#F79256}{|}&1&0\end{bmatrix}
Add −2-2 times the top row and add it to the bottom row
[15∣012−2(1)3−2(5)∣1−2(0)0−2(1)]=[15∣010−7∣1−2]\begin{bmatrix}1&5&\textcolor{#F79256}{|}&0&1\\2-2(1)&3-2(5)&\textcolor{#F79256}{|}&1-2(0)&0-2(1)\end{bmatrix}= \begin{bmatrix}1&5&\textcolor{#F79256}{|}&0&1\\0&-7&\textcolor{#F79256}{|}&1&-2\end{bmatrix}
Multiply the bottom row by −17-\frac{1}{7} to get the bottom row to be 0011
[15∣010−7−7−7∣1−7−2−7]=[15∣0101∣−1727]\begin{bmatrix}1&5&\textcolor{#F79256}{|}&0&1\\\frac{0}{-7}&\frac{-7}{-7}&\textcolor{#F79256}{|}&\frac{1}{-7}&\frac{-2}{-7}\end{bmatrix}= \begin{bmatrix}1&5&\textcolor{#F79256}{|}&0&1\\0&1&\textcolor{#F79256}{|}&-\frac{1}{7}&\frac{2}{7}\end{bmatrix}
Finally subtract 55 times the bottom row from the top row to remove the 55
[1−5(0)5−5(1)∣0−5(−17)1−5(27)01∣−1727]=[10∣57−3701∣−1727]\begin{bmatrix}1-5(0)&5-5(1)&\textcolor{#F79256}{|}&0-5(-\frac{1}{7})&1-5(\frac{2}{7})\\0&1&\textcolor{#F79256}{|}&-\frac{1}{7}&\frac{2}{7}\end{bmatrix}= \begin{bmatrix}1&0&\textcolor{#F79256}{|}&\frac{5}{7}&-\frac{3}{7}\\0&1&\textcolor{#F79256}{|}&-\frac{1}{7}&\frac{2}{7}\end{bmatrix}
So
[2315]−1=[57−37−1727]\begin{bmatrix}2&3\\1&5\end{bmatrix}^{-1}=\begin{bmatrix}\frac{5}{7}&-\frac{3}{7}\\-\frac{1}{7}&\frac{2}{7}\end{bmatrix}

Example 1.7: 3x3 Matrix

Find the inverse of [4−4441−2−3−3−4]\begin{bmatrix}4&-4&4\\4&1&-2\\-3&-3&-4\end{bmatrix}


Append the identity matrix. The divider is added to differentiate the two matrices.
[4−44∣10041−2∣010−3−3−4∣001]\begin{bmatrix}4&-4&4&\textcolor{#F79256}{|}&1&0&0\\4&1&-2&\textcolor{#F79256}{|}&0&1&0\\-3&-3&-4&\textcolor{#F79256}{|}&0&0&1\end{bmatrix}
Multiply the top row by 14\frac{1}{4}
[44−4444∣140041−2∣010−3−3−4∣001]=[1−11∣140041−2∣010−3−3−4∣001]\begin{bmatrix}\frac{4}{4}&\frac{-4}{4}&\frac{4}{4}&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\4&1&-2&\textcolor{#F79256}{|}&0&1&0\\-3&-3&-4&\textcolor{#F79256}{|}&0&0&1\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\4&1&-2&\textcolor{#F79256}{|}&0&1&0\\-3&-3&-4&\textcolor{#F79256}{|}&0&0&1\end{bmatrix}
Subtract 44 times the top row from the middle row and add 33 times the top row from the bottom row
[1−11∣14004−4(1)1−4(−1)−2−4(1)∣0−4(14)1−4(0)0−4(0)−3+3(1)−3+3(−1)−4+3(1)∣0+3(14)0+3(0)1+3(0)]=[1−11∣140005−6∣−1100−6−1∣3401]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\4-4(1)&1-4(-1)&-2-4(1)&\textcolor{#F79256}{|}&0-4(\frac{1}{4})&1-4(0)&0-4(0)\\-3+3(1)&-3+3(-1)&-4+3(1)&\textcolor{#F79256}{|}&0+3(\frac{1}{4})&0+3(0)&1+3(0)\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&5&-6&\textcolor{#F79256}{|}&-1&1&0\\0&-6&-1&\textcolor{#F79256}{|}&\frac{3}{4}&0&1\end{bmatrix}
Add the bottom row to the middle row
[1−11∣14000+05+(−6)−6+(−1)∣−1+(34)1+00+10−6−1∣3401]=[1−11∣14000−1−7∣−14110−6−1∣3401]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0+0&5+(-6)&-6+(-1)&\textcolor{#F79256}{|}&-1+(\frac{3}{4})&1+0&0+1\\0&-6&-1&\textcolor{#F79256}{|}&\frac{3}{4}&0&1\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&-1&-7&\textcolor{#F79256}{|}&-\frac{1}{4}&1&1\\0&-6&-1&\textcolor{#F79256}{|}&\frac{3}{4}&0&1\end{bmatrix}
Multiply the middle row by −1-1
[1−11∣14000−1(−1)−7(−1)∣−14(−1)1(−1)1(−1)0−6−1∣3401]=[1−11∣1400017∣14−1−10−6−1∣3401]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&-1(-1)&-7(-1)&\textcolor{#F79256}{|}&-\frac{1}{4}(-1)&1(-1)&1(-1)\\0&-6&-1&\textcolor{#F79256}{|}&\frac{3}{4}&0&1\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&7&\textcolor{#F79256}{|}&\frac{1}{4}&-1&-1\\0&-6&-1&\textcolor{#F79256}{|}&\frac{3}{4}&0&1\end{bmatrix}
Add 66 times the middle row to the bottom row
[1−11∣1400017∣14−1−10+6(0)−6+6(1)−1+6(7)∣34+6(14)0+6(−1)1+6(−1)]=[1−11∣1400017∣14−1−10041∣94−6−5]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&7&\textcolor{#F79256}{|}&\frac{1}{4}&-1&-1\\0+6(0)&-6+6(1)&-1+6(7)&\textcolor{#F79256}{|}&\frac{3}{4}+6(\frac{1}{4})&0+6(-1)&1+6(-1)\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&7&\textcolor{#F79256}{|}&\frac{1}{4}&-1&-1\\0&0&41&\textcolor{#F79256}{|}&\frac{9}{4}&-6&-5\end{bmatrix}
Multiply the bottom row by 141\frac{1}{41}
[1−11∣1400017∣14−1−10410414141∣(94)(141)−641−541]=[1−11∣1400017∣14−1−1001∣9164−641−541]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&7&\textcolor{#F79256}{|}&\frac{1}{4}&-1&-1\\\frac{0}{41}&\frac{0}{41}&\frac{41}{41}&\textcolor{#F79256}{|}&(\frac{9}{4})(\frac{1}{41})&\frac{-6}{41}&\frac{-5}{41}\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&7&\textcolor{#F79256}{|}&\frac{1}{4}&-1&-1\\0&0&1&\textcolor{#F79256}{|}&\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}
Subtract 77 times the bottom row from the middle row
[1−11∣14000−7(0)1−7(0)7−7(1)∣14−7(9164)−1−7(−641)−1−7(−541)001∣9164−641−541]=[1−11∣1400010∣−1182141−641001∣9164−641−541]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0-7(0)&1-7(0)&7-7(1)&\textcolor{#F79256}{|}&\frac{1}{4}-7(\frac{9}{164})&-1-7(-\frac{6}{41})&-1-7(-\frac{5}{41})\\0&0&1&\textcolor{#F79256}{|}&\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&0&\textcolor{#F79256}{|}&-\frac{11}{82}&\frac{1}{41}&-\frac{6}{41}\\0&0&1&\textcolor{#F79256}{|}&\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}
Add 11 times the middle row to the top row and subtract 11 times the bottom row to the top row
[1+0−0−1+1−01+0−1∣14+(−1182)−91640+141−(−641)0+(−641)−(−541)010∣−1182141−641001∣9164−641−541]=[100∣582741−141010∣−1182141−641001∣9164−641−541]\begin{bmatrix}1+0-0&-1+1-0&1+0-1&\textcolor{#F79256}{|}&\frac{1}{4}+(-\frac{11}{82})-\frac{9}{164}&0+\frac{1}{41}-(-\frac{6}{41})&0+(-\frac{6}{41})-(-\frac{5}{41})\\0&1&0&\textcolor{#F79256}{|}&-\frac{11}{82}&\frac{1}{41}&-\frac{6}{41}\\0&0&1&\textcolor{#F79256}{|}&\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}= \begin{bmatrix}1&0&0&\textcolor{#F79256}{|}&\frac{5}{82}&\frac{7}{41}&-\frac{1}{41}\\0&1&0&\textcolor{#F79256}{|}&-\frac{11}{82}&\frac{1}{41}&-\frac{6}{41}\\0&0&1&\textcolor{#F79256}{|}&\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}
So
[4−4441−2−3−3−4]−1=[582741−141−1182141−6419164−641−541]\begin{bmatrix}4&-4&4\\4&1&-2\\-3&-3&-4\end{bmatrix}^{-1}= \begin{bmatrix}\frac{5}{82}&\frac{7}{41}&-\frac{1}{41}\\-\frac{11}{82}&\frac{1}{41}&-\frac{6}{41}\\\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}


Solving Linear System of Equations with Matrices

In a system of linear equations with MM being a 3x3 matrix, X=[xyz]X=\begin{bmatrix}x\\y\\z\end{bmatrix}, and AA being the constant column matrix, then from MX=AMX=A,
M−1MX=X=M−1AM^{-1}MX=X=M^{-1}A
In other words, multiplying the inverse matrix by the constant matrix yields the solutions.

Example 1.8

Solve the following system using an inverse matrix
−12x−4y+4z=−210x+0y−4z=612x+12y+4z=−1 -12x-4y+4z=\textcolor{#F79256}{-21}\\ 0x+0y-4z=\textcolor{#F79256}{6}\\ 12x+12y+4z=\textcolor{#F79256}{-1}


The matrix form is
[−12−4400−412124][xyz]=[−216−1] \begin{bmatrix} -12&-4&4\\ 0&0&-4\\ 12&12&4 \end{bmatrix} \begin{bmatrix}x\\y\\z\end{bmatrix} =\begin{bmatrix} \textcolor{#F79256}{-21}\\ \textcolor{#F79256}{6}\\ \textcolor{#F79256}{-1} \end{bmatrix}
so the solution can be found with
[xyz]=[−12−4400−412124]−1[−216−1] \begin{bmatrix}x\\y\\z\end{bmatrix}= \begin{bmatrix} -12&-4&4\\ 0&0&-4\\ 12&12&4 \end{bmatrix}^{-1} \begin{bmatrix} \textcolor{#F79256}{-21}\\ \textcolor{#F79256}{6}\\ \textcolor{#F79256}{-1} \end{bmatrix}
The inverse was found in Example 1.5 so we have
[xyz]=[−1/8−1/6−1/241/81/41/80−1/40][−216−1]=[−(−21)/8−6/6−(−1)/24−21/8+6/4+−1/80−(6)/4+0]=[5/3−5/4−3/2] \begin{bmatrix}x\\y\\z\end{bmatrix}= \begin{bmatrix} -1/8&-1/6&-1/24\\ 1/8&1/4&1/8\\ 0&-1/4&0 \end{bmatrix} \begin{bmatrix} \textcolor{#F79256}{-21}\\ \textcolor{#F79256}{6}\\ \textcolor{#F79256}{-1} \end{bmatrix}= \begin{bmatrix} -(\textcolor{#F79256}{-21})/8-\textcolor{#F79256}{6}/6-(\textcolor{#F79256}{-1})/24\\ \textcolor{#F79256}{-21}/8+\textcolor{#F79256}{6}/4+\textcolor{#F79256}{-1}/8\\ 0-(\textcolor{#F79256}{6})/4+0 \end{bmatrix}= \begin{bmatrix} 5/3\\ -5/4\\ -3/2 \end{bmatrix}

Alternatively, you can apply Gauss-Jordan Elimination to directly solve the system
Instead of appending the identity matrix, append the constant matrix.

Example 1.9

Solve the following system using Gauss-Jordan Elimination
−12x−4y+4z=−210x+0y−4z=612x+12y+4z=−1 -12x-4y+4z=-21\\ 0x+0y-4z=6\\ 12x+12y+4z=-1


Create the matrix with the constants appended
[−12−44∣−2100−4∣612124∣−1]\begin{bmatrix}-12&-4&4&\textcolor{#F79256}{|}&-21\\0&0&-4&\textcolor{#F79256}{|}&6\\12&12&4&\textcolor{#F79256}{|}&-1\end{bmatrix}
Multiply all three rows by −14-\frac{1}{4}
[−12−4−4−44−4∣−21−40−40−4−4−4∣6−412−412−44−4∣−1]=[31−1∣214001∣−32−3−3−1∣14]\begin{bmatrix}\frac{-12}{-4}&\frac{-4}{-4}&\frac{4}{-4}&\textcolor{#F79256}{|}&\frac{-21}{-4}\\\frac{0}{-4}&\frac{0}{-4}&\frac{-4}{-4}&\textcolor{#F79256}{|}&\frac{6}{-4}\\\frac{12}{-4}&\frac{12}{-4}&\frac{4}{-4}&\textcolor{#F79256}{|}&-1\end{bmatrix}= \begin{bmatrix}3&1&-1&\textcolor{#F79256}{|}&\frac{21}{4}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\-3&-3&-1&\textcolor{#F79256}{|}&\frac{1}{4}\end{bmatrix}
Add 11 times the second row to the first and third row
[3+01+0−1+1∣214+(−32)001∣−32−3+0−3+0−1+1∣14+(−32)]=[310∣154001∣−32−3−30∣−54]\begin{bmatrix}3+0&1+0&-1+1&\textcolor{#F79256}{|}&\frac{21}{4}+(-\frac{3}{2})\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\-3+0&-3+0&-1+1&\textcolor{#F79256}{|}&\frac{1}{4}+(-\frac{3}{2})\end{bmatrix}= \begin{bmatrix}3&1&0&\textcolor{#F79256}{|}&\frac{15}{4}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\-3&-3&0&\textcolor{#F79256}{|}&-\frac{5}{4}\end{bmatrix}
Multiply the bottom row by −13-\frac{1}{3}
[310∣154001∣−32−3−3−3−30−3∣(−54)(−13)]=[310∣154001∣−32110∣512]\begin{bmatrix}3&1&0&\textcolor{#F79256}{|}&\frac{15}{4}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\\frac{-3}{-3}&\frac{-3}{-3}&\frac{0}{-3}&\textcolor{#F79256}{|}&(-\frac{5}{4})(-\frac{1}{3})\end{bmatrix}= \begin{bmatrix}3&1&0&\textcolor{#F79256}{|}&\frac{15}{4}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1&1&0&\textcolor{#F79256}{|}&\frac{5}{12}\end{bmatrix}
Subtract 11 times the bottom row from the top row
[3−11−10−0∣154−512001∣−32110∣512]=[200∣103001∣−32110∣512]\begin{bmatrix}3-1&1-1&0-0&\textcolor{#F79256}{|}&\frac{15}{4}-\frac{5}{12}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1&1&0&\textcolor{#F79256}{|}&\frac{5}{12}\end{bmatrix}= \begin{bmatrix}2&0&0&\textcolor{#F79256}{|}&\frac{10}{3}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1&1&0&\textcolor{#F79256}{|}&\frac{5}{12}\end{bmatrix}
Multiply the top row by 12\frac{1}{2}
[220202∣(103)(12)001∣−32110∣512]=[100∣53001∣−32110∣512]\begin{bmatrix}\frac{2}{2}&\frac{0}{2}&\frac{0}{2}&\textcolor{#F79256}{|}&(\frac{10}{3})(\frac{1}{2})\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1&1&0&\textcolor{#F79256}{|}&\frac{5}{12}\end{bmatrix}= \begin{bmatrix}1&0&0&\textcolor{#F79256}{|}&\frac{5}{3}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1&1&0&\textcolor{#F79256}{|}&\frac{5}{12}\end{bmatrix}
Subtract the top row from the bottom row
[100∣53001∣−321−11−00−0∣512−53]=[100∣53001∣−32010∣−54]\begin{bmatrix}1&0&0&\textcolor{#F79256}{|}&\frac{5}{3}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1-1&1-0&0-0&\textcolor{#F79256}{|}&\frac{5}{12}-\frac{5}{3}\end{bmatrix}= \begin{bmatrix}1&0&0&\textcolor{#F79256}{|}&\frac{5}{3}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\0&1&0&\textcolor{#F79256}{|}&-\frac{5}{4}\end{bmatrix}
Swap the second and third row
[100∣53010∣−54001∣−32]\begin{bmatrix}1&0&0&\textcolor{#F79256}{|}&\frac{5}{3}\\0&1&0&\textcolor{#F79256}{|}&-\frac{5}{4}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\end{bmatrix}
The left side is now the identity matrix and the right side represents the solution
(x,y,z)=(53,−54,−32)(x,y,z)=(\frac{5}{3},-\frac{5}{4},-\frac{3}{2})


Eigenvalues and Eigenvectors

Matrices are linear transformations, meaning they take the coordinate plane and stretch, rotate, and/or sheer it (see this video for an animation)
Some linear transformations have the same effect as a constant, only stretching it

Mathematical Example

Suppose you have a linear transformation (matrix) [1232]\begin{bmatrix}1&2\\3&2\end{bmatrix}
Applying this transformation to the vector [12]\begin{bmatrix}1\\2\end{bmatrix} results in the vector
[1232][12]=[1(1)+2(2)3(1)+2(2)]=[57]\begin{bmatrix}1&2\\3&2\end{bmatrix}\begin{bmatrix}1\\2\end{bmatrix}=\begin{bmatrix}1(1)+2(2)\\3(1)+2(2)\end{bmatrix}=\begin{bmatrix}5\\7\end{bmatrix}
This is clearly pointing in a different direction.
However, applying the transformation to the vector [23]\begin{bmatrix}2\\3\end{bmatrix} results in the vector
[1232][23]=[1(2)+2(3)3(2)+2(3)]=[812]=4[23]\begin{bmatrix}1&2\\3&2\end{bmatrix}\begin{bmatrix}2\\3\end{bmatrix}=\begin{bmatrix}1(2)+2(3)\\3(2)+2(3)\end{bmatrix}=\begin{bmatrix}8\\12\end{bmatrix}=4\begin{bmatrix}2\\3\end{bmatrix}
This is clearly the same vector stretched by a factor of 4.
Thus, linear transformations can have the same effect as a constant when applied to certain vectors.

Solving for eigenvalues and eigenvectors

If we have a linear transformation (matrix) AA, vectorx⃗\vec{x}, and constantλ\lambda, we must have
Ax⃗=λx⃗A\vec{x}=\lambda \vec{x}
This indicates that multiplying a vector by AA has the same effect as λ\lambda, so λ\lambda is the eigenvalue and x⃗\vec{x} is the corresponding eigenvector.
We subtract both sides of the equation by λx\lambda x and factor so that
(A−λI)x⃗=0→∣A−λI∣∣x⃗∣=0(A-\lambda I)\vec{x}=0\rightarrow |A-\lambda I||\vec{x}|=0
Note that because we cannot subtract a matrix by a number, we multiply the number by the identity matrixII so that we have a matrix minus a matrix.
So either ∣A−λI∣=0|A-\lambda I|=0 or ∣x⃗∣=0|\vec{x}|=0. Having ∣x⃗∣=0|\vec{x}|=0 is pointless since that's just the 00-vector, so ∣A−λI∣=0|A-\lambda I|=0.
Write the expression for the determinant in terms of λ\lambda and solve for when it equals 00. This expression is called the characteristic polynomial. That solves for λ\lambda.
Then multiply out (A−λI)x⃗(A-\lambda I)\vec{x}, where x⃗=<x1,x2,⋯>\vec{x} = <x_1, x_2,\cdots>, and attempt to solve the system of equations.
One is likely a multiple of the other, so the best you can do is write one part of x⃗\vec{x} in terms of other parts of x⃗\vec{x}, so the eigenvector will be parametrized by a parameter tt.

Process Summary

  1. Solve for λ\lambda using ∣A−λI∣=0→|A-\lambda I|=0\rightarrow eigenvalues
  2. Expand(A−λI)x⃗(A-\lambda I)\vec{x}, assuming x⃗=<x1,x2⋅>\vec{x}=<x_1,x_2\cdot>
  3. Simplify as best as possible the system of equations created from (A−λI)x⃗=0→(A-\lambda I)\vec{x}=0\rightarrow eigenvectors
Example 1.10

Find the eigenvalues and eigenvectors for A=[1232]A=\begin{bmatrix}1&2\\3&2\end{bmatrix}


We first find the characteristic polynomial
∣A−λI∣=∣1−λ232−λ∣=(1−λ)(2−λ)−2(3)=λ2−3λ−4=(λ−4)(λ+1)=0|A-\lambda I|=\begin{vmatrix}1-\lambda&2\\3&2-\lambda\end{vmatrix}=(1-\lambda)(2-\lambda)-2(3)=\lambda^2-3\lambda-4=(\lambda-4)(\lambda+1)=0
So, the eigenvalues are λ=4\lambda=4 and λ=−1\lambda=-1
We now have two cases, one for each eigenvalue:

In conclusion, for any real tt, we have:

Side Note

The product of the eigenvalues equals the determinant:
λ1λ2=4(−1)=−4=1(2)−2(3)=det⁡(A)\lambda_1\lambda_2=4(-1)=-4=1(2)-2(3)=\det(A)

Example 1.11

Find the eigenvalues and eigenvectors of [01−2−65−4003]\begin{bmatrix}0&1&-2\\-6&5&-4\\0&0&3\end{bmatrix}


The characteristic polynomial is ∣0−λ1−2−65−λ−4003−λ∣=(3−λ)∣−λ1−65−λ∣=(3−λ)(λ2−5λ+6)=(3−λ)(λ−3)(λ−2)=0\begin{vmatrix}0-\lambda&1&-2\\-6&5-\lambda&-4\\0&0&3-\lambda\end{vmatrix}=(3-\lambda)\begin{vmatrix}-\lambda&1\\-6&5-\lambda\end{vmatrix}=(3-\lambda)(\lambda^2-5\lambda+6)=(3-\lambda)(\lambda-3)(\lambda-2)=0
So there are only two eigenvalues, λ=2\lambda=2 and λ=3\lambda=3

In conclusion, for any real tt and ss:


Symmetrical and Orthogonal Matrices

The transpose (ATA^T) is a matrix where rows become columns
element aija_{ij} in matrix AA is element ajia_{ji} in matrix ATA^T

Properties of the Transpose

let AA and BB be matrices and kk a constant

If A=ATA=A^T, then matrix AA is symmetric
orthogonal vectors have a dot product of 00, i.e. are 90∘90^\circ apart
Theorem about symmetric matrices

In a symmetric matrix, any two eigenvectors of distinct eigenvalues are orthogonal

For a symmetrical matrix AA, let λ1\lambda_1 have eigenvector x⃗1\vec{x}_1 and λ2\lambda_2 have eigenvector x⃗2\vec{x}_2, with λ1≠λ2\lambda_1\ne\lambda_2.
Then we have
λ2(x⃗1⋅x⃗2)=λ2x⃗1x⃗2T=x⃗1λ2x⃗2T=x⃗1Ax⃗2T\lambda_2(\vec{x}_1\cdot\vec{x}_2)=\lambda_2\vec{x}_1\vec{x}_2^T=\vec{x}_1\lambda_2\vec{x}_2^T=\vec{x}_1A\vec{x}_2^T
Since A=ATA=A^T,
x⃗1Ax⃗2T=x⃗1ATx⃗2T=(Ax⃗1T)Tx⃗2T=(λ1x⃗1T)Tx⃗2T=λ1(x⃗1T)Tx⃗2T=λ1(x⃗1x⃗2T)=λ1(x⃗1⋅x⃗2)\vec{x}_1A\vec{x}_2^T=\vec{x}_1A^T\vec{x}_2^T=(A\vec{x}_1^T)^T\vec{x}_2^T=(\lambda_1\vec{x}_1^T)^T\vec{x}_2^T=\lambda_1(\vec{x}_1^T)^T\vec{x}_2^T=\lambda_1(\vec{x}_1\vec{x}_2^T)=\lambda_1(\vec{x}_1\cdot\vec{x}_2)
So, lambda1(x⃗1⋅x⃗2)=λ2(x⃗1⋅x⃗2)→(λ1−λ2)(x⃗1⋅x⃗2)=0lambda_1(\vec{x}_1\cdot\vec{x}_2)=\lambda_2(\vec{x}_1\cdot\vec{x}_2)\rightarrow(\lambda_1-\lambda_2)(\vec{x}_1\cdot\vec{x}_2)=0
Since λ1−λ2≠0\lambda_1-\lambda_2\ne0, x⃗1⋅x⃗2=0\vec{x}_1\cdot\vec{x}_2=0, meaning the two vectors are orthogonal. ■\blacksquare

Let diag(a11,a22,⋯,ann)diag(a_{11},a_{22},\cdots, a_{nn}) denote an n×nn\times n matrix where every entry is 00 except the diagonals, which are a11,a22,⋯,anna_{11}, a_{22},\cdots, a_{nn} respectively
Then an n×nn\times n matrix AA with eigenvalues λ1,λ2,⋯,λn\lambda_1,\lambda_2,\cdots,\lambda_n is similar to diag(λ1,λ2,⋯,λn)diag(\lambda_1,\lambda_2,\cdots,\lambda_n)

If MMT=IMM^T=I, or equivalently, M−1=MTM^{-1}=M^T, MM is called orthogonal

Example 1.12

Prove that the rotation transformation matrix, M=[cos⁡θ−sin⁡θsin⁡θcos⁡θ]M=\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix}, is orthogonal.


If MM is orthogonal, then MMT=IMM^T=I
MMT=[cos⁡θ−sin⁡θsin⁡θcos⁡θ][cos⁡θsin⁡θ−sin⁡θcos⁡θ]=[(cos⁡θ)2+(−sin⁡θ)2cos⁡θsin⁡θ−cos⁡θsin⁡θsin⁡θcos⁡θ−sin⁡θcos⁡θsin⁡2θ+cos⁡2θ]=[1001]=IMM^T=\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix}\begin{bmatrix}\cos\theta&\sin\theta\\-\sin\theta&\cos\theta\end{bmatrix}=\begin{bmatrix}(\cos\theta)^2+(-\sin\theta)^2&\cos\theta\sin\theta-\cos\theta\sin\theta\\\sin\theta\cos\theta-\sin\theta\cos\theta&\sin^2\theta+\cos^2\theta\end{bmatrix}=\begin{bmatrix}1&0\\0&1\end{bmatrix}=I
Since we have shown that MMT=IMM^T=I, MM is an orthogonal matrix. ■\blacksquare